// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import StartUp from "../../lib/StartUp";
import CM from "../../lib/cache/CM";
import { monitor } from "../../lib/common/Decorator";
import MsgMgr from "../../lib/event/MsgMgr";

import Scene from "../../lib/scene/Scene";
import UIMgr from "../../lib/ui/UIMgr";
import DBattle from "../cache/DBattle";
import DUser from "../cache/DUser";
import MsgEnum from "../common/MsgEnum";
import DBLevel from "../config/DBLevel";
import FieldManager from "../fight/manager/FieldManager";
import MachineManager from "../fight/manager/MachineManager";
import PlayManager from "../fight/manager/PlayManager";
import RoleManager from "../fight/manager/RoleManager";
import UIGame from "../ui/UIGame";
import UIHall from "../ui/UIHall";




const {ccclass, property} = cc._decorator;

@ccclass
export default class GameScene extends Scene {

    public type(): number {
        return 1;
    }

    public async onEnter() {
        UIMgr.ins(UIMgr).show(UIGame);
        await FieldManager.ins(FieldManager).init();
        await MachineManager.ins(MachineManager).init();
        await RoleManager.ins(RoleManager).init();
        await PlayManager.ins(PlayManager).init();
    }

    public update(dt: any): void {
        
    }

    public onExit(): void {
        UIMgr.ins(UIMgr).close(UIGame);
    }

    
    
}
